#include "service.h"

CACHE_MAP *cacheMap = new CACHE_MAP(10);

bool SuggestionService::start(int argc, char* argv[], int&)
{
    google::ParseCommandLineFlags(&argc, &argv, true);
    google::InitGoogleLogging(argv[0]);

    try {
        _adapter = communicator()->createObjectAdapter("Suggestion");
        _props = communicator()->getProperties();
        _adapter->add(new sgI(_props, cacheMap), communicator()->stringToIdentity("kxSuggestion"));
        _adapter->activate();
    } catch (const Ice::Exception& e) {
        MYLOG_FATAL << "ICE Error";
    } catch (const std::string& msg) {
        MYLOG_FATAL << "ICE Error" << msg ;
    }
    return true;
}
